package edu.pku.sei.act.ctrl.editpart;

import java.beans.PropertyChangeEvent;

import org.eclipse.draw2d.IFigure;

import edu.pku.sei.act.ctrl.figure.TimerFigure;
import edu.pku.sei.act.images.ArchiModelImageProvider;
import edu.pku.sei.act.model.mote.Timer;
import edu.pku.sei.gmp.controller.editpart.GMPNodeEditPart;

public class TimerEditPart extends GMPNodeEditPart{

	protected IFigure createFigure() {
		return new TimerFigure("Timer",ArchiModelImageProvider.TIMERLARGE);
	}

	private Timer getTimer() {
		return (Timer) getModelElement();
	}

	public void handlePropertyChanged(PropertyChangeEvent event) {
		refreshVisuals();
		super.handlePropertyChanged(event);
	}

	protected void refreshVisuals() {
		((TimerFigure)figure).setName("Timer");
		super.refreshVisuals();
	}
	
}
